﻿@page "/radios"
@inject IStringLocalizer<Radios> Localizer

<h3>@Localizer["Title"]</h3>

<h4>@Localizer["H1"]</h4>

<Block Title="" Introduction="">
    <RadioList TValue="string" Items="@DemoValues" OnSelectedChanged="@OnSelectedChanged"></RadioList>
    <BlockLogger @ref="Trace" class="mt-3" />
</Block>

<Block Title="@Localizer["Blcok2Title"]" Introduction='@Localizer["Block2Intro"]'>
    <RadioList TValue="string" Items="@DemoValues" IsDisabled="true" ShowBorder="false"></RadioList>
</Block>

<Block Title="@Localizer["Blcok3Title"]" Introduction="@Localizer["Block3Intro"]">
    <RadioList TValue="string" Items="@DemoValues" ShowLabel="true" DisplayText="@Localizer["RadioText"]"></RadioList>
</Block>

<Block Title="@Localizer["Blcok4Title"]" Introduction="@Localizer["Block4Intro"]">
    <div class="row g-3">
        <div class="col-12">
            <RadioList Items="@Items" @bind-Value="@BindRadioItem" OnSelectedChanged="@OnItemChanged"></RadioList>
        </div>
        <div class="col-12">
            <div>Text: @BindRadioItem.Text Value: @BindRadioItem.Value</div>
        </div>
    </div>
    <BlockLogger @ref="BinderLog" />
</Block>

<Block Title="@Localizer["Block5Title"]" Introduction="@Localizer["Block5Intro"]">
    <RadioList TValue="string" Items="@DemoValues" IsVertical="true"></RadioList>
</Block>

<Block Title="@Localizer["Block6Title"]" Introduction="@Localizer["Block6Intro"]">
    <RadioList @bind-Value="@SelectedEnumItem"></RadioList>
    <p class="mt-3">@((MarkupString)Localizer["P1"].Value)</p>
    <RadioList @bind-Value="@SelectedEnumItem" IsAutoAddNullItem="true" NullItemText="@Localizer["RadioText2"]"></RadioList>
</Block>

<Block Title="@Localizer["Block7Title"]" Introduction="@Localizer["Block7Intro"]">
    <div class="row g-3">
        <div class="col-12">
            <RadioList TValue="string" Items="@DemoValues" Color="@Color.Primary"></RadioList>
        </div>
        <div class="col-12">
            <RadioList TValue="string" Items="@DemoValues" Color="@Color.Success"></RadioList>
        </div>
        <div class="col-12">
            <RadioList TValue="string" Items="@DemoValues" Color="@Color.Danger"></RadioList>
        </div>
        <div class="col-12">
            <RadioList TValue="string" Items="@DemoValues" Color="@Color.Info"></RadioList>
        </div>
        <div class="col-12">
            <RadioList TValue="string" Items="@DemoValues" Color="@Color.Warning"></RadioList>
        </div>
        <div class="col-12">
            <RadioList TValue="string" Items="@DemoValues" Color="@Color.Secondary"></RadioList>
        </div>
    </div>
</Block>

<AttributeTable Items="@GetAttributes()" />

<EventTable Items="@GetEvents()" />
